package example;

import com.pangus.toolkits.files.FSClient;
import com.pangus.toolkits.files.FSConfig;
import com.pangus.toolkits.files.model.FileInfo;
import com.pangus.toolkits.files.model.FileLink;

import java.io.IOException;
import java.util.List;

/**
 * @author yingheng chen
 * @description
 * @date 2019/12/4
 */
public class Usage {
    public static void main(String[] args) throws IOException {
        final FSConfig config = FSConfig.builder().serverUrl("localhost")
                .port(8080).build();
        final FSClient client = new FSClient(config);
        final List<FileLink> fileLinks = client.fileLinkList("/");
        final FileLink upload = client.upload("./hello.txt", "/");
        final FileLink fileLink = client.fileLink("/hello.txt");
        final FileInfo fileInfo = fileLink.getFileInfo();
        fileLink.download("D:\\code\\java\\client\\src\\test\\resources");
        fileLink.delete();
    }
}
